package sunyu.quartz.common.config;

import org.slf4j.Logger;
import sunyu.kit.common.LogKit;
import sunyu.kit.database.DataBaseKit;

import javax.sql.DataSource;

/**
 * Quartz使用的数据库初始化类
 *
 * @author 孙宇
 */
public class QuartzDataBaseKitInit {

    public static final String quartzDataBase = "quartzDataBase";

    private static final Logger logger = LogKit.getLogger();

    private DataSource dataSource;

    public DataSource getDataSource() {
        return dataSource;
    }

    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    public void init() {
        logger.info("sunyu-quartz-common初始化NutzDao");

        DataBaseKit.addDao(QuartzDataBaseKitInit.quartzDataBase, dataSource);
    }

}
